<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function Person() {
        // this = {
        //   __proto__:Person.prototype
        // }
        // this.username = "jack";
        // return this;
      }
      Person.prototype.username = "lili";
      Person.prototype.say = function () {
        console.log("hello say");
      };

      // 1
      const p1 = new Person();
      console.log(p1.username); //lili
      p1.say();

      //2
      const p2 = new Person();
      console.log(p2.username); // lili
      p1.say();
    </script>
  </body>
</html>
